#include <stddef.h>
#include <stdlib.h>

extern "C" {
	int __cxa_atexit(void (*f)(void *), void *p, void *d) {
		(void) f;
		(void) p;
		(void) d;
		return 0;
	}
 
	/* This currently destroys all objects */
	void __cxa_finalize(void *d) {
		(void) d;
	}

	void __cxa_pure_virtual() {
		while (1);
		//cout << "OH, SHEEP!" << endl;
	}
}

void *__dso_handle;

void *operator new(size_t size) {
	return malloc(size);
}

void *operator new[](size_t size) {
	return malloc(size);
}

void operator delete(void *p) {
	free(p);
}

void operator delete[](void *p) {
	free(p);
}

